function* smallNumbers() {
  console.log("next() 第一次被调用，参数被丢弃");
  let y1 = yield 1;
  console.log("next() 第二次调用，参数是", y1);
  let y2 = yield 2;
  console.log("next() 第三次调用，参数是", y2);
  let y3 = yield 3;
  console.log("next() 第四次调用，参数是", y3);
  return 4;
}

const g = smallNumbers();
console.log("创建了生成器，代码未运行");
const n1 = g.next("a"); // n1.value == 1
console.log("生成器回送", n1);
const n2 = g.next(123, "b"); // n2.value == 2
console.log("生成器回送", n2);
const n3 = g.next("c"); // n3.value == 2
console.log("生成器回送", n3);
const n4 = g.next("d"); // n4 = {value: 4, done: true}
console.log("生成器回送", n4);
